//==============================================================================
#ifndef _CLUAAPI_H_
    #define _CLUAAPI_H_

extern "C" {
    #include "lua.h"
    #include "lualib.h"
    #include "lauxlib.h"
}

//==============================================================================
#define EVENT_NONE 0

#define EVENT_PLAYER_LOGGED_IN      (EVENT_NONE + 1)
#define EVENT_PLAYER_LOGGED_OUT     (EVENT_NONE + 2)
#define EVENT_PLAYER_DISCONNECTED   (EVENT_NONE + 3)

#define EVENT_PLAYER_ENTERED_AREA   (EVENT_NONE + 4)
#define EVENT_PLAYER_LEFT_AREA      (EVENT_NONE + 5)
#define EVENT_PLAYER_ENTERED_MAP    (EVENT_NONE + 6)
#define EVENT_PLAYER_LEFT_MAP       (EVENT_NONE + 7)

#define EVENT_PLAYER_DIED           (EVENT_NONE + 8)
#define EVENT_PLAYER_KILLED_PLAYER  (EVENT_NONE + 9)
#define EVENT_PLAYER_KILLED_ENTITY  (EVENT_NONE + 10)
#define EVENT_PLAYER_OPEN           (EVENT_NONE + 11)
#define EVENT_PLAYER_PUSH           (EVENT_NONE + 12)
#define EVENT_PLAYER_PULL           (EVENT_NONE + 13)

//------------------------------------------------------------------------------
#define PLAYER_PROPERTY_NONE 0

#define PLAYER_PROPERTY_CONTROLS    (PLAYER_PROPERTY_NONE + 1)
#define PLAYER_PROPERTY_COLLISION   (PLAYER_PROPERTY_NONE + 2)
#define PLAYER_PROPERTY_INVINCIBLE  (PLAYER_PROPERTY_NONE + 3)

//==============================================================================
int Lua_Camera_SetCenter(lua_State* Lua_Handle);
int Lua_Camera_SetCenterToEntity(lua_State* Lua_Handle);
int Lua_Camera_SetCenterToPlayer(lua_State* Lua_Handle);
int Lua_Camera_SetPosition(lua_State* Lua_Handle);
int Lua_Camera_Move(lua_State* Lua_Handle);

int Lua_Chat_Clear(lua_State* Lua_Handle);
int Lua_Chat_Say(lua_State* Lua_Handle);

int Lua_Entity_Add(lua_State* Lua_Handle);
int Lua_Entity_CreateSpawnPoint(lua_State* Lua_Handle);
int Lua_Entity_FollowEntity(lua_State* Lua_Handle);
int Lua_Entity_FollowPlayer(lua_State* Lua_Handle);
int Lua_Entity_GetHealth(lua_State* Lua_Handle);
int Lua_Entity_Heal(lua_State* Lua_Handle);
int Lua_Entity_Hurt(lua_State* Lua_Handle);
int Lua_Entity_Move(lua_State* Lua_Handle);
int Lua_Entity_Remove(lua_State* Lua_Handle);
int Lua_Entity_RemoveSpawnPoint(lua_State* Lua_Handle);
int Lua_Entity_Say(lua_State* Lua_Handle);
int Lua_Entity_SetAlpha(lua_State* Lua_Handle);
int Lua_Entity_SetAnimation(lua_State* Lua_Handle);
int Lua_Entity_SetAnimationLoop(lua_State* Lua_Handle);
int Lua_Entity_SetAnimationSpeed(lua_State* Lua_Handle);
int Lua_Entity_SetDimensions(lua_State* Lua_Handle);
int Lua_Entity_SetHealth(lua_State* Lua_Handle);
int Lua_Entity_SetPosition(lua_State* Lua_Handle);
int Lua_Entity_SetRotation(lua_State* Lua_Handle);

int Lua_FontEngine_Load(lua_State* Lua_Handle);
int Lua_FontEngine_Print(lua_State* Lua_Handle);
int Lua_FontEngine_PrintDialog(lua_State* Lua_Handle);

int Lua_Image_Add(lua_State* Lua_Handle);
int Lua_Image_Move(lua_State* Lua_Handle);
int Lua_Image_Remove(lua_State* Lua_Handle);
int Lua_Image_SetAlpha(lua_State* Lua_Handle);
int Lua_Image_SetAnimation(lua_State* Lua_Handle);
int Lua_Image_SetAnimationLoop(lua_State* Lua_Handle);
int Lua_Image_SetAnimationSpeed(lua_State* Lua_Handle);
int Lua_Image_SetDimensions(lua_State* Lua_Handle);
int Lua_Image_SetPosition(lua_State* Lua_Handle);
int Lua_Image_SetRotation(lua_State* Lua_Handle);

int Lua_Light_Add(lua_State* Lua_Handle);
int Lua_Light_Global(lua_State* Lua_Handle);
int Lua_Light_Remove(lua_State* Lua_Handle);
int Lua_Light_SetAlpha(lua_State* Lua_Handle);
int Lua_Light_SetColor(lua_State* Lua_Handle);

int Lua_Music_Add(lua_State* Lua_Handle);
int Lua_Music_Loop(lua_State* Lua_Handle);
int Lua_Music_Play(lua_State* Lua_Handle);
int Lua_Music_Queue(lua_State* Lua_Handle);
int Lua_Music_SetVolume(lua_State* Lua_Handle);

int Lua_Player_Ban(lua_State* Lua_Handle);
int Lua_Player_DisableProperty(lua_State* Lua_Handle);
int Lua_Player_Disconnect(lua_State* Lua_Handle);
int Lua_Player_EnableProperty(lua_State* Lua_Handle);
int Lua_Player_GetHealth(lua_State* Lua_Handle);
int Lua_Player_GetValue(lua_State* Lua_Handle);
int Lua_Player_Heal(lua_State* Lua_Handle);
int Lua_Player_Hurt(lua_State* Lua_Handle);
int Lua_Player_IsBanned(lua_State* Lua_Handle);
int Lua_Player_Move(lua_State* Lua_Handle);
int Lua_Player_Say(lua_State* Lua_Handle);
int Lua_Player_SetAlpha(lua_State* Lua_Handle);
int Lua_Player_SetAnimation(lua_State* Lua_Handle);
int Lua_Player_SetAnimationLoop(lua_State* Lua_Handle);
int Lua_Player_SetAnimationSpeed(lua_State* Lua_Handle);
int Lua_Player_SetDimensions(lua_State* Lua_Handle);
int Lua_Player_SetHealth(lua_State* Lua_Handle);
int Lua_Player_SetPosition(lua_State* Lua_Handle);
int Lua_Player_SetRotation(lua_State* Lua_Handle);
int Lua_Player_SetValue(lua_State* Lua_Handle);
int Lua_Player_Warp(lua_State* Lua_Handle);

int Lua_SoundBank_Add(lua_State* Lua_Handle);
int Lua_SoundBank_Play(lua_State* Lua_Handle);
int Lua_SoundBank_Remove(lua_State* Lua_Handle);
int Lua_SoundBank_SetPosition(lua_State* Lua_Handle);
int Lua_SoundBank_SetVolume(lua_State* Lua_Handle);

int Lua_System_GetFPS(lua_State* Lua_Handle);
int Lua_System_GetSpeedFactor(lua_State* Lua_Handle);
int Lua_System_GetUptime(lua_State* Lua_Handle);
int Lua_System_GetValue(lua_State* Lua_Handle);
int Lua_System_LogError(lua_State* Lua_Handle);
int Lua_System_LogNotice(lua_State* Lua_Handle);
int Lua_System_SetValue(lua_State* Lua_Handle);

int Lua_Timer_GetElapsedTime(lua_State* Lua_Handle);
int Lua_Timer_Pause(lua_State* Lua_Handle);
int Lua_Timer_Start(lua_State* Lua_Handle);
int Lua_Timer_Stop(lua_State* Lua_Handle);
//==============================================================================

#endif
